//这个模块 主要对文章数据处理
import axios from '@/utils/myaxios.js'


//获取指定的饿栏目的文章列表数据
// params :{}

export const getArticleList = (params) => {
    return axios({
        url: '/post',
        params

    })
}

// 2.根据文章的id获取文章详情
export const getArticleById = (id) => {
    return axios({
        url: `/post/${id}`
    })
}

// 3.点赞和取消点赞  
export const post_like = (id) => {
    return axios({
        url: `/post_like/${id}`
    })
}


// 4.收藏和取消收藏
export const post_star = (id) => {
    return axios({
        url: `/post_star/${id}`
    })
}

// 5.获取文章评论列表
export const getArticleComments = (id, params) => {
    return axios({
        url: `/post_comment/${id}`,
        params
    })
}

// 6.发表评论
export const replyComment = (id, data) => {
    return axios({
        method: 'post',
        url: `/post_comment/${id}`,
        data
    })
}